#!/user/bin/env set PYTHONIOENCODING=utf-8 && python -u
# -*- coding: utf-8 -*-

import inspect

from collections.abc import Callable, Collection, Mapping, Iterable
from decimal import Decimal
from datetime import datetime

class Primitives(object):

  @staticmethod
  def is_awaitable(obj):
    return inspect.isawaitable(obj)

  @staticmethod
  def is_callable(obj):
    return isinstance(obj, Callable)

  @staticmethod
  def is_iterable(obj):
    return isinstance(obj, Iterable)

  @staticmethod
  def is_collection(obj):
    return isinstance(obj, Collection)

  @staticmethod
  def is_dict(obj):
    return isinstance(obj, Mapping)

  @staticmethod
  def is_bytes(obj):
    return isinstance(obj, (bytes, bytearray))

  @staticmethod
  def is_str(obj):
    return isinstance(obj, str)

  @staticmethod
  def is_bool(obj):
    return isinstance(obj, bool)

  @staticmethod
  def is_int(obj):
    return isinstance(obj, int)

  @staticmethod
  def is_float(obj):
    return isinstance(obj, float)

  @staticmethod
  def is_decimal(obj):
    return isinstance(obj, Decimal)

  @staticmethod
  def is_number(obj):
    return isinstance(obj, (int, float, Decimal))

  @staticmethod
  def is_datetime(obj):
    return isinstance(obj, datetime)
